#%RAML 0.8
title: OICLight
version: v1.0-20150910
schemas:
  - OICLight: !include oic.r.light.json
    OICLightError: !include oic.r.light-error.json

traits:
  - interface:
      queryParameters:
        if:
          enum: ["oic.if.a"]

/oic/r/light:
  description: |
    Resource to be exposed by any OIC Device that can act as Light.
  displayName: OIC Light
  is: [ interface ] # valid for all methods

  get:
    responses:
      200:
        body:
          application/json:
            schema: OICLight
            example: |
              {
                "rt":     "oic.r.light",
                "id":     "light_id",
                "power":  "off"
              }
  post:
    body:
      application/json:
        schema: OICLight
        example: |
          {
            "id":    "light_id",
            "power":  "off"
          }
    responses:
      200:
        body:
          application/json:
            schema: OICLight
            example: |
              {
                "id":    "light_id",
                "power":  "off"
              }
      403:
        description: |
          This response is generated by the OIC Server when the client sends:
            An update with an out of range property value for intensity.
          The server responds with the range property illustrating the error.
        body:
          application/json:
            schema: OICLightError
            example: |
              {
                "id":     "light_id",
                "range":  "10,20"
              }